﻿@model CustomerAvatarModel
@using Nop.Web.Models.Customer;
@{
    Layout = "~/Views/Shared/_Root.cshtml";

    //title
    Html.AddTitleParts(T("PageTitle.Account").Text);
}
@*set "data-ajax" attribute to "false" because jQuery Mobile does not support file uploading*@
@using (Html.BeginRouteForm("CustomerAvatar", FormMethod.Post,
    new Dictionary<string, Object> { { "enctype", "multipart/form-data" }, { "data-ajax", "false" } }))
{
    <div class="page account-page avatar-page">
        <div class="page-title">
            <h1>@T("Account.Avatar")</h1>
        </div>
        <div class="page-body">
            <div class="message-error">
                @Html.ValidationSummary(true)
            </div>
            <div class="section-body">
                @if (!String.IsNullOrEmpty(Model.AvatarUrl))
                {
                    <div class="image">
                        <img src="@(Model.AvatarUrl)" alt="avatar" />
                    </div>
                }
                <input name="uploadedFile" type="file" />
            </div>
            <div class="buttons">
                <input type="submit" name="upload-avatar" value="@T("Common.Upload")" />
                @if (!String.IsNullOrEmpty(Model.AvatarUrl))
                {
                    <input type="submit" name="remove-avatar" value="@T("Account.Avatar.RemoveAvatar")" />
                }
            </div>
            <div>
                @T("Account.Avatar.UploadRules")</div>
        </div>
    </div>
}